-
Notifications
You must be signed in to change notification settings - Fork 566
Update color tokens #8977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Update color tokens #8977
Conversation
d8d0ca4
to
681cd6a
Compare
681cd6a
to
b9bc862
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you!
src/common/gui/ThemeController.ts
Outdated
* Since the number of new tokens is less than the number of old tokens, it is impossible to map all colors. Thus, this is just for mitigation purposes. | ||
* This mapper could be removed after all users who have whitelabel color customization have migrated to the new color tokens. | ||
*/ | ||
public static mapOldToNewColorTokens(customizations: Partial<ThemeCustomizations>): ThemeCustomizations { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
old customizations are not Partial<ThemeCustomizations>
right? It is rather keyof typeof oldToNewColorTokenMap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have noticed that the customisations that can be passed to mapOldToNewColorTokens
can possibly be ThemeCustomizations
or keyof typeof oldToNewColorTokenMap
, so I updated it to be able to handle both. We could add a method to check whether the customisation contains the old tokens, and could check it before calling mapOldToNewColorTokens
, but I think the current implementation is simpler and should be OK as it is.
error: SONNE, | ||
surface: light_white, | ||
surface_container: grey_lighter_4, | ||
on_surface_fade: grey_lighter_0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where does on_surface_fade
come from? Did we invent it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I created this since there was no token that matched the colour. It is mainly used for the icons for ColumnEmptyMessageBox
, but it could not fit into any type of surface, surface container or outline. I don't think this is the best solution and it should only be used for migration purposes. When we update the colour themes, the icons should also be updated to match the M3 colour tokens. I have added a deprecated warning to the token for now.
Nice, thank you for the changes! |
Replaced old color tokens with new tokens that follow the Material 3 Design system.
- Added mapper of new/old color tokens. - Added a message to prompt admin users with whitelabel customisation to check and update their settings.
- Added deprecated comment for `on_surface_fade` - Fix typings for `mapOldToNewColorTokens` and `mapNewToOldColorTokens` - Fix comment for `UpdateColorCustomizationNews`
- Update color tokens for chips - Remove duplicated `outline_variant` color token
f75be00
to
09ab2ff
Compare
To provide a basis for building Tuta's design system, we will update the colour tokens to follow the colour rules of the Material 3 design system.
For the users with whitelabel customisation, we perform old/new colour token mapping to ease the migration process.
close #8965